package test.project.system.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zjnu.cmf.framework.web.BaseController;
import zjnu.cmf.project.system.bean.Dept;
import zjnu.cmf.project.system.service.IDeptService;

import java.util.List;

/**
 * @classname:
 * @description:
 * @author:Chen Mingfang
 * @data:on 2018/11/3 14:16
 * @version:1.0
 */
@Controller
@RequestMapping("/system/fing")
public class findController extends BaseController {
    private String prefix = "system/dept";

    @Autowired
    private IDeptService deptService;




    @RequiresPermissions("system:user:view")
    @GetMapping()
    public String find()
    {
        return prefix + "/find";
    }

    /**
     * 查询部门列表
     */

    @GetMapping("/list")
    @ResponseBody
    public List<Dept> list(Dept dept, String deptName, ModelMap map) {

        List<Dept> deptList = deptService.selectDeptList(dept);
        map.put("deptName", deptName);
        return deptList;
    }
}